﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace NetworkSupervisor
{
    /// <summary>
    /// 模式进度窗口
    /// </summary>
    public partial class FormLoadProgress : DevExpress.XtraEditors.XtraForm
    {
        public int Position
        {
            get { return progressBarControl1.Position; }
            set { progressBarControl1.Position = value; }
        }

        public int Maximum
        {
            get { return progressBarControl1.Properties.Maximum; }
            set { progressBarControl1.Properties.Maximum = value; }
        }

        public string Info
        {
            get { return lblInfo.Text; }
            set { lblInfo.Text = value; }
        }

        public FormLoadProgress()
        {
            InitializeComponent();
        }

        public FormLoadProgress(string info, int maximum)
        {
            InitializeComponent();
            this.Info = info;
            this.Maximum = maximum;
        }

        private void FormCannotClosed_Load(object sender, EventArgs e)
        {
            
        }

        /// <summary>
        /// 设置显示信息
        /// </summary>
        /// <param name="info"></param>
        public void mySetInfo(string info)
        {
            lblInfo.Text = info;
        }

        /// <summary>
        /// 关闭窗口
        /// </summary>
        public void myClose()
        {
            Close();
        }

        /// <summary>
        /// 设置精度条位置
        /// </summary>
        /// <param name="pos"></param>
        public void mySetProgressPosition(int pos)
        {
            progressBarControl1.Position = pos;
        }

        /// <summary>
        /// 设置进度条最大值
        /// </summary>
        /// <param name="max"></param>
        public void mySetProgressMaximum(int max)
        {
            progressBarControl1.Properties.Maximum = max;
        }

        private void FormCannotClosed_FormClosing(object sender, FormClosingEventArgs e)
        {
           
        }
    }
}